home comics writing pictures archive about

TypeCache.cpp

Language: C++
Last Modified: 2022-08-18 12:03:01 AM UTC
File Size: 844 bytes
http://www.penguinstew.ca/example/CodeFormater/TypeCache.cpp
includeTypeCacheh
TypeCache::TypeCache
{
types=std::vector<Type>;
langs=std::vector<Lang>;
}
TypeTypeCache::LoadLanguagestd::stringtype
{
forunsignedinti=0;i<typelength;i
{
type[i]=tolowertype[i];
}
forunsignedinti=0;i<typessize;i
{
Typet=typesati;
iftGetExtcomparetype==0
{
returnt;
}
}
Typet=Typetype;
typespush_backt;
forunsignedinti=0;i<tGetLangssize;i
{
Langl=tGetLangsati;
langspush_backl;
}
returnt;
}
LangTypeCache::FindStartLangstd::stringlineintposTypeIdPairtypeId
{
forunsignedinti=0;i<langssize;i
{
Langl=langsati;
ifl>IsStartlinepostypeId
{
returnl;
}
}
returnNULL;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49